<?php /* Smarty version 2.6.18, created on 2007-07-10 17:21:23
         compiled from Player/players_new.tpl */ ?>
<?php if ($this->_tpl_vars['tourney'] == 0): ?>
<p>No se ha creado un torneo a&uacute;n, por lo tanto no se pueden crear jugadores</p>
<?php elseif ($this->_tpl_vars['delegations'] == 0): ?>
<p>No hay delegaciones, por lo tanto no se puede crear un nuevo jugador</p>
<?php else: ?>
<form id="new">
    <table>
        <tbody>
        <tr height="13">
            <td width="22%">Nombres:</td>
            <td>
                <input id="pla_first_name" name="pla_first_name" type="text" size="25" onfocus="switchColor('pla_first_name',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Apellidos:</td>
            <td>
                <input id="pla_last_name" name="pla_last_name" type="text" size="25" onfocus="switchColor('pla_last_name',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Documento:</td>
            <td>
                <input id="pla_document" name="pla_document" type="text" size="25" maxlength="10" onkeypress="return onlyNumbers(event);" onfocus="switchColor('pla_document',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">G&eacute;nero:</td>
            <td>
                <input type="radio" name="pla_gender" value="m">Masculino
                &nbsp;
                <input type="radio" name="pla_gender" value="f">Femenino
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Fecha de Nacimiento:</td>
            <td>
                <select id="day" onfocus="switchColor('day',&#034;#999999&#034;);">
                    <option value="">dd</option>
                    <?php unset($this->_sections['age1']);
$this->_sections['age1']['name'] = 'age1';
$this->_sections['age1']['start'] = (int)1;
$this->_sections['age1']['loop'] = is_array($_loop=32) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['age1']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['age1']['show'] = true;
$this->_sections['age1']['max'] = $this->_sections['age1']['loop'];
if ($this->_sections['age1']['start'] < 0)
    $this->_sections['age1']['start'] = max($this->_sections['age1']['step'] > 0 ? 0 : -1, $this->_sections['age1']['loop'] + $this->_sections['age1']['start']);
else
    $this->_sections['age1']['start'] = min($this->_sections['age1']['start'], $this->_sections['age1']['step'] > 0 ? $this->_sections['age1']['loop'] : $this->_sections['age1']['loop']-1);
if ($this->_sections['age1']['show']) {
    $this->_sections['age1']['total'] = min(ceil(($this->_sections['age1']['step'] > 0 ? $this->_sections['age1']['loop'] - $this->_sections['age1']['start'] : $this->_sections['age1']['start']+1)/abs($this->_sections['age1']['step'])), $this->_sections['age1']['max']);
    if ($this->_sections['age1']['total'] == 0)
        $this->_sections['age1']['show'] = false;
} else
    $this->_sections['age1']['total'] = 0;
if ($this->_sections['age1']['show']):

            for ($this->_sections['age1']['index'] = $this->_sections['age1']['start'], $this->_sections['age1']['iteration'] = 1;
                 $this->_sections['age1']['iteration'] <= $this->_sections['age1']['total'];
                 $this->_sections['age1']['index'] += $this->_sections['age1']['step'], $this->_sections['age1']['iteration']++):
$this->_sections['age1']['rownum'] = $this->_sections['age1']['iteration'];
$this->_sections['age1']['index_prev'] = $this->_sections['age1']['index'] - $this->_sections['age1']['step'];
$this->_sections['age1']['index_next'] = $this->_sections['age1']['index'] + $this->_sections['age1']['step'];
$this->_sections['age1']['first']      = ($this->_sections['age1']['iteration'] == 1);
$this->_sections['age1']['last']       = ($this->_sections['age1']['iteration'] == $this->_sections['age1']['total']);
?>
                        <option value="<?php if ($this->_sections['age1']['index'] < 10): ?>0<?php endif; ?><?php echo $this->_sections['age1']['index']; ?>
"><?php echo $this->_sections['age1']['index']; ?>
</option>
                    <?php endfor; endif; ?>
                </select>
                <select id="month" onfocus="switchColor('month',&#034;#999999&#034;);">
                    <option value="">mm</option>
                    <?php unset($this->_sections['age2']);
$this->_sections['age2']['name'] = 'age2';
$this->_sections['age2']['start'] = (int)1;
$this->_sections['age2']['loop'] = is_array($_loop=13) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['age2']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['age2']['show'] = true;
$this->_sections['age2']['max'] = $this->_sections['age2']['loop'];
if ($this->_sections['age2']['start'] < 0)
    $this->_sections['age2']['start'] = max($this->_sections['age2']['step'] > 0 ? 0 : -1, $this->_sections['age2']['loop'] + $this->_sections['age2']['start']);
else
    $this->_sections['age2']['start'] = min($this->_sections['age2']['start'], $this->_sections['age2']['step'] > 0 ? $this->_sections['age2']['loop'] : $this->_sections['age2']['loop']-1);
if ($this->_sections['age2']['show']) {
    $this->_sections['age2']['total'] = min(ceil(($this->_sections['age2']['step'] > 0 ? $this->_sections['age2']['loop'] - $this->_sections['age2']['start'] : $this->_sections['age2']['start']+1)/abs($this->_sections['age2']['step'])), $this->_sections['age2']['max']);
    if ($this->_sections['age2']['total'] == 0)
        $this->_sections['age2']['show'] = false;
} else
    $this->_sections['age2']['total'] = 0;
if ($this->_sections['age2']['show']):

            for ($this->_sections['age2']['index'] = $this->_sections['age2']['start'], $this->_sections['age2']['iteration'] = 1;
                 $this->_sections['age2']['iteration'] <= $this->_sections['age2']['total'];
                 $this->_sections['age2']['index'] += $this->_sections['age2']['step'], $this->_sections['age2']['iteration']++):
$this->_sections['age2']['rownum'] = $this->_sections['age2']['iteration'];
$this->_sections['age2']['index_prev'] = $this->_sections['age2']['index'] - $this->_sections['age2']['step'];
$this->_sections['age2']['index_next'] = $this->_sections['age2']['index'] + $this->_sections['age2']['step'];
$this->_sections['age2']['first']      = ($this->_sections['age2']['iteration'] == 1);
$this->_sections['age2']['last']       = ($this->_sections['age2']['iteration'] == $this->_sections['age2']['total']);
?>
                        <option value="<?php if ($this->_sections['age2']['index'] < 10): ?>0<?php endif; ?><?php echo $this->_sections['age2']['index']; ?>
"><?php echo $this->_sections['age2']['index']; ?>
</option>
                    <?php endfor; endif; ?>
                </select>
                <select id="year" onfocus="switchColor('year',&#034;#999999&#034;);">
                    <option value="">aaaa</option>
                    <?php 
                        $year_start = date("Y")-17;
                        $i=1;
                        while($i<=7)
                        {
                            echo '<option value="'.$year_start.'">'.$year_start.'</option>';
                            $year_start--;
                            $i++;
                        }
                     ?>
                </select>
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Delegacion:</td>
            <td>
                <select id="pla_del_id" name="pla_del_id" onfocus="switchColor('pla_del_id',&#034;#999999&#034;);">
                    <option value="">--Selecciona--</option>
                    <?php $_from = $this->_tpl_vars['delegations']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['del']):
?>
                    <option value="<?php echo $this->_tpl_vars['del']['del_id']; ?>
"><?php echo $this->_tpl_vars['del']['del_name']; ?>
</option>
                    <?php endforeach; endif; unset($_from); ?>
                </select>
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Lugar de Nacimiento:</td>
            <td>
                <input id="pla_place_birth" name="pla_place_birth" type="text" size="25" onfocus="switchColor('pla_place_birth',&#034;#999999&#034;);" />
                <span id="indicator1" style="display:none;">
                    <img src="images/spinner.gif" alt="Buscando..." align="top" />
                </span>
                <div id="choices" class="autocomplete" style="display:none;"></div>
                <?php echo '
                <script type="text/javascript" language="JavaScript">
                    autocompleter(\'pla_place_birth\', \'choices\', \'Player/WP_Player.php?action=11\');
                </script>
                '; ?>

            </td>
        </tr>
        <tr height="13">
            <td width="22%">Altura (mts):</td>
            <td>
                <input id="pla_height" name="pla_height" type="text" size="5" maxlength="6" onkeypress="return onlyFloatNumbers(event);" onfocus="switchColor('pla_height',&#034;#999999&#034;);" />
            </td>
        </tr>
        <tr height="13">
            <td width="22%">Peso (kg):</td>
            <td>
                <input id="pla_weight" name="pla_weight" type="text" size="5" maxlength="6" onkeypress="return onlyFloatNumbers(event);" onfocus="switchColor('pla_weight',&#034;#999999&#034;);" />
            </td>
        </tr>

        <tr>
            <td />
            <td>
                <input class="button" type="button" value="Crear" onclick="if(validate_player()) sendPlayer('new','content_area','Player/WP_Player.php?action=6');" />
                <input class="button" type="reset" value="Limpiar" />
            </td>
        </tr>
        </tbody>
    </table>
</form>
<?php endif; ?>